﻿<!--#include file="include/conn_f.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<br />
<center>
    <%
name=saferequest("name",0)
email=saferequest("email",0)
phone=saferequest("phone",0)
mobile=saferequest("mobile",0)
qq=saferequest("qq",0)
address=saferequest("address",0)
country=saferequest("country",0)
city=saferequest("city",0)
zip=saferequest("zip",0)
cust_id=Session("cust_id")
If cust_id<>"" Then
    sql="select * from customer where cust_id="&cust_id 
    Set rs=conn.execute(sql)
    If Not rs.eof Then
        old_phone=rs("phone")
        old_mobile=rs("mobile")
        sql="INSERT INTO customer_history(cust_id,name,email,phone,mobile,qq,address,zip,country,city,update_time,operator) values("
        sql=sql&cust_id&",'"&rs("name")&"','"&rs("email")&"','"&rs("phone")&"','"&rs("mobile")&"','"&rs("qq")&"','"
        sql=sql&rs("address")&"','"&rs("zip")&"','"&rs("country")&"','"&rs("city")&"',now(),'客户自修改')"
        conn.execute(sql)

        sql="update customer set name='"&name&"',email='"&email&"',phone='"&phone&"',mobile='"&mobile&"',qq='"&qq&"'"
        If old_phone<>phone Then
            sql=sql&",phone_confirmed=0,phone_type=-1"
        End If
        If old_mobile<>mobile Then
            sql=sql&",mobile_confirmed=0"
        End If
        sql=sql&",address='"&address&"',country='"&country&"',city='"&city&"',zip='"&zip&"' where cust_id="&cust_id
        conn.execute(sql)
        Response.Write "个人资料修改成功!"
    Else
        Response.Write "出错,没有此会员帐号!"
    End If
End If
    %>
    <!--#include file="bottom.asp"-->
